#include "CommandDone.h"

void CommandDone::execute() {
	if( _doneType == DONE_INDEX ) {
		_logicDone->doneByIndex( _index );
	} else if( _doneType == DONE_SEARCHTERM ) {
		_logicDone->doneBySearchTerm( _searchTerm );
	} else {
		// idle state
	}
}

CommandDone::CommandDone( int index ) {
	_doneType = DONE_INDEX;
	_index = index;
}

CommandDone::CommandDone( string searchTerm ) {
	_doneType = DONE_SEARCHTERM;
	_searchTerm = searchTerm;
}